package ar.uade.distribuidas.tpo.dba.dominio;

import javax.persistence.*;

@Entity
@Table(name = "empresas")
@PrimaryKeyJoinColumn(name = "empresa_id", referencedColumnName = "cuil")
public class Empresa extends Cliente {

	public String razonSocial;

	public Empresa() {
		super();
	}

	public Empresa(long cuil, String razonSocial) {
		super(cuil);
		this.razonSocial = razonSocial;
	}
	
	

	public String getRazonSocial() {
		return razonSocial;
	}

	public void setRazonSocial(String razonSocial) {
		this.razonSocial = razonSocial;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + ((razonSocial == null) ? 0 : razonSocial.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		Empresa other = (Empresa) obj;
		if (razonSocial == null) {
			if (other.razonSocial != null)
				return false;
		} else if (!razonSocial.equals(other.razonSocial))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "Empresa [razonSocial=" + razonSocial + "]";
	}

}
